package com.itheima.mapper;

import com.itheima.pojo.Setmeal;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SetmealMapper {
    @Insert("insert into t_setmeal (id, name, code, helpCode, sex,age,price ,remark, attention,img) VALUES " +
    "(null,#{name},#{code},#{helpCode},#{sex},#{age},#{price},#{remark},#{attention},#{img})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void add(Setmeal setmeal);

    void addGroups(@Param("ids") Integer[] checkgroupIds, @Param("id") Integer id);

    void edit(Setmeal setmeal);

    void deleteGroups(Integer id);

    Setmeal findById(Integer id);

    List<Setmeal> findPage(String queryString);
}
